<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>computed option</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>computed options</h1>
    <hr>
    <div id="app">
        <p>{{newPrice}}</p>
        <ul>
            <li v-for="item in reverNews">{{item.title}}--{{item.data}}</li>
        </ul>
    </div>

    <script type="text/javascript">
        var newsList=[
            {title:'四部门联合印发《2018年网络扶贫工作要点》',data:'2018/06/13'},
            {title:'国家税务总局：国地税改革进入具体实施操作阶段',data:'2018/06/14'},
            {title:'企业所得税税前扣除凭证管理办法发布 7月1日起施行',data:'2018/06/15'},
            {title:'各地陆续公布高考放榜时间:川甘两省最早22日可查',data:'2018/06/16'}
        ]
        var app = new Vue({
            el:'#app',
            data:{
                price:100,
                newsList:newsList
            },
            computed:{
                newPrice:function(){
                    return this.price='￥'+this.price+'元';
                },
                reverNews:function(){
                    return this.newsList.reverse();
                }
            }

        })
    </script>
</body>
</html>